/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package main;

import javax.swing.event.*;
import javax.swing.table.*;
/**
 *
 * @author Mantas, Ramūnas, Vilius
 */
public class TableManager extends AbstractTableModel {
    private String[] columnNames = new String[Memory.MAX_BLOCKS];
    public TableManager(){
        
        int i;
        Integer temp;
        for(i=0; i<Memory.MAX_BLOCKS; i++){
            if(i==0){
                columnNames[i]="";
            }
            else{
                temp=i-1;
                columnNames[i]=temp.toString();
            }
        }
    }
    @Override
    public String getColumnName(int columnIndex){
        return columnNames[columnIndex];
    }
    public int getRowCount(){
        return Memory.MAX_MEMORY;
    };
    public int getColumnCount(){
        return Memory.MAX_BLOCKS;
    };
    public String getValueAt(int rowIndex, int columnIndex){
        columnIndex--;
        return Memory.getMemoryFrom(rowIndex, columnIndex);
    }
}
